home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / TGCBOR20.ARJ / TUTOR.COM / QUICK.TXT < prev    next >
Text File  |  1991-08-27  |  9KB  |  235 lines

  1.                  TEGL WINDOWS TOOLKIT II - Release II
  2.                          Introductory Package
  3.  
  4.                COPYRIGHT 1991 TEGL SYSTEMS CORPORATION
  5.                          ALL RIGHTS RESERVED
  6.  
  7.  
  8. This is an introductory package for evaluating the TEGL WINDOWS
  9. TOOLKIT II. You may use it to create programs on a trial basis. You
  10. make not use these programs in a commercial environment or distribute
  11. them to others.
  12.  
  13. The commercial version of the TEGL WINDOWS TOOLKIT is provided with
  14. royalty-free distribution of compiled applications.
  15.  
  16.  
  17. What is the TEGL Windows Toolkit II?
  18.  
  19. The TEGL Windows Toolkit II is really three toolkits in one; a
  20. graphics interface, a memory manager and a window manager. Together
  21. these parts provide a programming environment.
  22.  
  23. What does the TEGL Windows Toolkit II do?
  24.  
  25. The TEGL Windows Toolkit II provides tools for creating
  26. eye-appealing, functional and intuitive graphical user interfaces
  27. in your programs.
  28.  
  29. Overlapping windows are automatically managed. Window images are
  30. saved so the application does not have to redraw a window if it is
  31. just moved or uncovered. A window that is resized does have to be
  32. redrawn.
  33.  
  34. The overhead of maintaining graphics images in memory is overcome
  35. by the virtual memory manager. Your application can also use
  36. virtual memory.
  37.  
  38. The TEGL Windows Toolkit II handles all mouse and keyboard
  39. activities, this includes all selections of menu items and mouse
  40. click areas. For instance, when a user wants to move a window, the
  41. teglsupervisior handles all of the user interaction from the click
  42. of the right mouse button on a window to when the button is
  43. released to indicate the new position. You may also define your own
  44. Event to look after window moves. An Event is a funtion that you
  45. write that gets control when the teglsupervisor determines that an
  46. action has occured.
  47.  
  48. TEGL GRAPHICS INTERFACE
  49.  
  50. The graphics consist of a low level set of routines that look
  51. after the initialization and loading of the correct graphics driver,
  52. as well as, graphics primitives and a high-level interface that
  53. provides traditional graphics features. This high-level interface
  54. module, TGraph, is a virtual plug in replacement for the
  55. Borland Graphics Interface (BGI).
  56.  
  57. Users familiar with BGI will have little problem utilizing the TEGL
  58. Graphics Interface (TGI). This part of the TEGL Windows Toolkit II can
  59. be used separately from the rest of the toolkit. There are no
  60. dependencies on the memory manager nor the window manager.
  61.  
  62. TEGL VIRTUAL MEMORY MANAGER
  63.  
  64. The memory manager provides two important items: a heap manager
  65. that provides blocks of memory greater than 64K and virtual memory
  66. so the heap can utilize other memory resources (EMS or hard drive).
  67.  
  68. The memory manager can be used by itself, that is, it has no
  69. dependencies on either the graphics tools or the window manager.
  70. The programer utilizes the memory manager through a handle. The memory
  71. allocated this way can be swapped out (to disk or EMS)  to satisfy
  72. other requests, then swapped back in when needed.
  73.  
  74. When working with larger graphics buffers virtual memory becomes a
  75. necessity. Generally you can ignore the virtual memory manager
  76. since it works tranparently with the window manager. You only need
  77. to use it if your application will need to use virtual memory.
  78.  
  79.  
  80. TEGL WINDOW MANAGER
  81.  
  82. The window manager uses both TEGL graphics and the virtual memory
  83. manager. A primary job of the window manager is to look after the
  84. graphics image on each window and to keep track of where a window
  85. is located on the stack. When a window is moved, brought to the top
  86. of the stack or disposed of, then the window manager determines
  87. which screen image has to be restored. This may involve resolving
  88. many image fragments from numerous windows, fortunately this is
  89. done automatically and the programmer needn't concern himself with
  90. it. When the window manager is processing graphic images and there
  91. are a number of windows displayed, RAM memory may not be sufficient
  92. to do all the processing and virtual memory is used.
  93.  
  94. Progamming with the TEGL Windows Toolkit II requires a different
  95. strategy than traditional structured programming. This doesn't mean
  96. that your programs will be un-structured, just that the hierarchy
  97. will be less straight forward, but more dynamic.
  98.  
  99.  
  100. INITIALIZATION
  101.  
  102. There are several items to set for optomizing the system at start-up.
  103.  
  104.             * window manager resolution
  105.             * standard heap size
  106.             * reserved heap size
  107.             * video mode
  108.             * registering a driver
  109.  
  110. The window manager resolution determines the minimum amount of memory
  111. required by the virtual memory manager to process images. Roughly it
  112. require twice what the resolution is set to. See WINDOW MANAGER.
  113.  
  114. You must specify how much memory you will need for standard heap use. Be
  115. sure to allow for the amount of memory that the compiler functions will
  116. require. In particular buffered I/O in C can need a fair bit. If unsure
  117. about memory requirements then you should code some monitoring functions
  118. that watch this. The function to call to set the heap use is:
  119.  
  120. void setstandardheapsize(unsigned long heapsize);
  121.  
  122. The next function does the video startup and sets the initial amount of the
  123. huge heap.
  124.  
  125. void teglinit(char *videomodename, long hugeminimum);
  126.  
  127. The videomodename is the required mode to startup in, (see
  128. videoautodetect and video modes which follows) and hugeminimum is
  129. the initial size of the huge heap reserverd area.
  130.  
  131.  
  132. void videoautodetect(void);
  133.  
  134. This function will autodetect the graphics hardware and return the
  135. appropriate video mode name. Note that Super VGA modes cannot be
  136. autodetected. If your program is designed to work with one of these
  137. then it should have an override or be installable for that mode.
  138.  
  139. A safe start up for a program would be:
  140.  
  141.  
  142.      maxwindowsize = 0x00008000;         \*  32 K *\
  143.      setstandardheapsize(0xFFFF);        \*  64 K *\
  144.      teglinit(videoautodetect(),0x4000);
  145.  
  146.  
  147. Then adjust the values to find the optimum. Set maxwindowsize to the
  148. highest possible value for best performance.
  149.  
  150.  
  151. For simplified startup (as most of the example programs use) just
  152. use either easytegl or tweasystart as the first call in the main
  153. body of your program.
  154.  
  155.  
  156. ---------------------------------------------------------------
  157. EVENTS
  158. ---------------------------------------------------------------
  159.  
  160. Events are mouse clicks and key presses. There can also be timer-events
  161. but these are more tricky. When an event occurs teglsupervisor (the event
  162. supervisor) calls an event-handler.
  163.  
  164.  
  165. The declaration of an event-handler is:
  166.  
  167. unsigned myevent(imagestkptr ifs, msclickptr ms);
  168.   {
  169.   }
  170.  
  171.  
  172. The parameters ifs and ms tell use what frame this event was called from
  173. and the corresponding mouse click area on that frame. Depending on what
  174. an event-handler needs to know these items contain information that is
  175. useful. The imagestkptr is always the from the frame the mouse click
  176. area orginated from. Sometimes there may be related frames, in this
  177. case that frame is passed in the related stack. It can be accessed by
  178. using ifs->relatedstack.
  179.  
  180. Event-handlers are called from menu selections, keypresses, mouse clicks,
  181. button presses (a variant of mouse click), and timer ticks.
  182.  
  183.  
  184.  
  185. ---------------------------------------------------------------
  186. TEXT and FONTS SYSTEM
  187. ---------------------------------------------------------------
  188.  
  189. The TELG WINDOWS TOOLKIT II uses fast bit-mapped fonts and can also
  190. use the BGI vector fonts.
  191.  
  192.  
  193. setteglfont(fontptr font);
  194.  
  195. Set the font that will be used in subsequent text output. To use the
  196. f8x8bold you would type in:
  197.  
  198. setteglfont(f8x8bold);
  199.  
  200.  
  201. fontptr getteglfont(void);
  202.  
  203. Returns the currently set font.
  204.  
  205.  
  206. The names of the available fonts follow. These are contained in the
  207. module TEGLFONT.
  208.  
  209.      pc3270, apls7, brdwx19, broadway, countdwn, fraktur, gaelic,
  210.      georgian, italic, lcdfont, light14, light9, litalic, m3270,
  211.      ocr, sansx19, script2, script, wndws19, ega09, font14, font07,
  212.      font07cp, font09, future, oenglish, pc24, pc9,
  213.  
  214.      f8x12nor, f8x12bol, f8x8norm, f8x8bold, f8x8ital, f7x7norm,
  215.      f7x7bold, f6x6norm, f5x6norm
  216.  
  217. void outtegltextxy(int x, int y, char *str);
  218.  
  219. x, y are the coordinates to place the text at. str is the string for
  220. output. The font used is the currently set font.
  221.  
  222. This routine is affected by the justification settings set by
  223. settextjustify and color by setcolor.
  224.  
  225. Only bit-mapped fonts are output by outtegltextxy.
  226.  
  227. void setproportional(char onoff);
  228.  
  229. This sets proportional spacing for bit-mapped fonts. If it is set to
  230. FALSE then the characters are spaces at 8 bits.
  231.  
  232.  
  233. ---------------------------------------------------------------------
  234. END QUICK.TXT
  235.